package com.liqin.nothing.config.sensitiveword;

import com.github.houbb.heaven.util.lang.StringUtil;
import com.github.houbb.sensitive.word.api.context.InnerSensitiveWordContext;
import com.github.houbb.sensitive.word.support.ignore.AbstractSensitiveWordCharIgnore;

import java.util.Set;

/**
 * @author gonghl
 * @since 2024/8/13 下午 2:58
 */
public class MyIgnoreChar extends AbstractSensitiveWordCharIgnore {

    private static final Set<Character> SET = StringUtil.toCharSet("`-=~!@#$%^&*()_+[]{}\\|;:'\",./<>?1234567890 ");

    @Override
    protected boolean doIgnore(int ix, char[] chars, InnerSensitiveWordContext innerContext) {
        char c = chars[ix];
        return SET.contains(c);
    }
}
